package cc.aiee.zalopay.core.tool;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.TimeZone;

public class ZalopayTool {

	/**
	 * 
	 * @param format 默认值:yyMMdd
	 * @return
	 */
	public static String getCurrentTimeString(String format) {
		if (null == format) {
			format = "yyMMdd";
		}
		Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT+7"));
		SimpleDateFormat fmt = new SimpleDateFormat(format);
		fmt.setCalendar(cal);
		return fmt.format(cal.getTimeInMillis());
	}

	public static String getRefundId(String appid, String refundNo) {
		return getCurrentTimeString(null) + "_" + appid + "_" + refundNo;
	}
	public static String getTransId(String orderNo) {
		return getCurrentTimeString(null) + "_" + orderNo;
		
	}
}
